1. Field of the Invention
The present invention relates to a method for overwriting data onto a tape recording apparatus, and specifically to a technique for overwriting data that facilitates judgment on whether data is new or old when the data is to be read.
2. Description of the Related Art
Some tape drives such as those complying with LTO (Linear Tape Open) limit an interval between data units, i.e., units of writing and reading data, to a predetermined length or less (four meters or less in the LTO standard) for taking account of reading sequential data from a tape medium. Serial numbers are assigned to data units that are written onto a tape medium, and recorded onto the tape medium with the data units as management information.
The above-described rules are also applied to a case in which the data recorded onto the tape medium is overwritten with another data. Even if the tape medium has a fault such as damage, the faulty area is skipped and data may be overwritten at a position within a predetermined length from the overwrite-specified position. In such a case, however, since old data is left in the skipped area, information indicating whether the data is new or old is also recorded on the tape medium with the data units as management information (WO2003/083866).
In the LTO standard, the information indicating whether the data is new or old is called TapeWritePass (TWP). TWP is started at one and incremented by one each time when data is overwritten. It is assumed that, in the case of data reading, a data unit with a certain number is read and then another data unit with the same number that is present within the predetermined length from the first data unit is read. In that case, the data unit with the bigger value of TWP is dealt as the latest data, i.e., effective data.
That means a certain data unit cannot be determined as the latest data immediately after the data unit is read. In other words, in order to confirm that the read data unit is valid, the data for the predetermined length (four meters in the LTO standard) from the read data unit needs to be read and confirmed that the data does not include a data unit with the same data unit number as that of the read data and also with the bigger TWP than that of the read data. That requires quite complicated processing.
That is why some conventional tape drives such as those complying with LTO adopt a method below: assuming that data following the data unit with the number N is to be overwritten, the method requires the data unit with a new TWP value and the number N+1 to be written in a predetermined range (several millimeters) from the end of the data unit with the number N. In that manner, the method ensures that the old data with the number N+1 to be overwritten.
If data is overwritten in that manner, data unit C with the number M (M=N+1) and TWP (M) (here, TWP (N+1)>TWP (M)>=x) is not present between data unit A with the number N and TWP (N)=x and data unit B with the number N+1 and TWP (N+1)>=x, in principle. Therefore, since the data unit A can be confirmed as a valid data unit when the data unit B is found, quite a simple method for judging validity of data can be provided. TWP (i) indicates the TWP for the data unit with the number i.
Due to a fault such as damage to the tape medium, the data following the data unit with the number N cannot be written in the predetermined range (several millimeters) from the end of the data unit with the number N. In that case, information indicating that the write starting position is shifted is kept in a cartridge memory provided for the tape medium. Even in the case in which the data unit C is included as a result of shifting the write starting position, the above-described simple method for judging validity of data can be avoided in reading the data in that area based on the information indicating that the write stating position is shifted since the information is recorded in the cartridge memory. Accordingly, the old data cannot be mistaken for new data.